"""
URL configuration for djangoProject project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include # 添加子路由需要使用include函数

import user.views
from user.views import *   # 我们要添加user应用下的函数，需要先导包

urlpatterns = [
    # 自己定义的路由规则，导入相对应的函数，只写函数名，不能加括号
    # path('index01/',user.views.test01),
    # path('index02/',user.views.test02),

    # 添加子路由，一般一个应用对应一个子视图
    # 对于path的一个参数，这里写的是'user/'，就表示多了一层路由，就变成了/user/index01/
    # 当然也可以不写，那就还是/index01/，推荐写上并且和包名字一样
    # 注意'user/'斜杆别没了，'user'就需要访问/userindex01/了
    path('user/',include('user.urls')),
    path('admin/', admin.site.urls),
]
